//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package corntab;

import java.util.Date;

public class CrontabIterator extends AbstractScheduleIterator {
    private String _$49573;
    private CrontabEntry _$49760;
    private Date _$1804;
    private Date _$7122;
    private Date _$49762;

    public CrontabIterator(String crontab, Date start, Date end) {
        this._$49573 = null;
        this._$49762 = null;
        if (start == null) {
            throw new IllegalArgumentException("start must not be null.");
        } else {
            this._$49573 = crontab;

            try {
                this._$49760 = CrontabParser.marshall(this._$49573);
                boolean[] bSeconds = new boolean[60];
                boolean[] bYears = new boolean[10];
                CrontabParser.parseToken("*", bYears, false);
                this._$49760.setBYears(bYears);
                this._$49760.setYears("*");
                CrontabParser.parseToken("0", bSeconds, false);
                this._$49760.setBSeconds(bSeconds);
                this._$49760.setSeconds("0");
            } catch (CrontabEntryException var6) {
                var6.printStackTrace();
                throw new IllegalArgumentException(var6.getMessage());
            }

            this._$1804 = start;
            this._$7122 = end;
            this._$49762 = this._$1804;
        }
    }

    public CrontabIterator(String crontab, Date start) {
        this(crontab, start, (Date)null);
    }

    public CrontabIterator(String crontab) {
        this(crontab, new Date(), (Date)null);
    }

    public Date next() {
        Date time = null;
        time = CalendarBuilder.buildCalendar(this._$49760, this._$49762);
        this._$49762 = new Date(time.getTime() + (long)5900);
        return this._$7122 != null && time.after(this._$7122) ? null : time;
    }
}
